Integrand size = 19, antiderivative size = 73 \[ \int \cos (c+d x) (a+a \sec (c+d x))^4 \, dx=4 a^4 x+\frac {13 a^4 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^4 \sin (c+d x)}{d}+\frac {4 a^4 \tan (c+d x)}{d}+\frac {a^4 \sec (c+d x) \tan (c+d x)}{2 d} \]
4*a^4*x+13/2*a^4*arctanh(sin(d*x+c))/d+a^4*sin(d*x+c)/d+4*a^4*tan(d*x+c)/d +1/2*a^4*sec(d*x+c)*tan(d*x+c)/d
Leaf count is larger than twice the leaf count of optimal. \(272\) vs. \(2(73)=146\).
Time = 5.28 (sec) , antiderivative size = 272, normalized size of antiderivative = 3.73 \[ \int \cos (c+d x) (a+a \sec (c+d x))^4 \, dx=\frac {1}{64} a^4 (1+\cos (c+d x))^4 \sec ^8\left (\frac {1}{2} (c+d x)\right ) \left (16 x-\frac {26 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {26 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {4 \cos (d x) \sin (c)}{d}+\frac {4 \cos (c) \sin (d x)}{d}+\frac {1}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {16 \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}-\frac {1}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {16 \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right ) \]
(a^4*(1 + Cos[c + d*x])^4*Sec[(c + d*x)/2]^8*(16*x - (26*Log[Cos[(c + d*x) /2] - Sin[(c + d*x)/2]])/d + (26*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) /d + (4*Cos[d*x]*Sin[c])/d + (4*Cos[c]*Sin[d*x])/d + 1/(d*(Cos[(c + d*x)/2 ] - Sin[(c + d*x)/2])^2) + (16*Sin[(d*x)/2])/(d*(Cos[c/2] - Sin[c/2])*(Cos [(c + d*x)/2] - Sin[(c + d*x)/2])) - 1/(d*(Cos[(c + d*x)/2] + Sin[(c + d*x )/2])^2) + (16*Sin[(d*x)/2])/(d*(Cos[c/2] + Sin[c/2])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]))))/64
Time = 0.28 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3042, 4278, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cos (c+d x) (a \sec (c+d x)+a)^4 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^4}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4278 |
\(\displaystyle \int \left (a^4 \cos (c+d x)+a^4 \sec ^3(c+d x)+4 a^4 \sec ^2(c+d x)+6 a^4 \sec (c+d x)+4 a^4\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {13 a^4 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^4 \sin (c+d x)}{d}+\frac {4 a^4 \tan (c+d x)}{d}+\frac {a^4 \tan (c+d x) \sec (c+d x)}{2 d}+4 a^4 x\) |
4*a^4*x + (13*a^4*ArcTanh[Sin[c + d*x]])/(2*d) + (a^4*Sin[c + d*x])/d + (4 *a^4*Tan[c + d*x])/d + (a^4*Sec[c + d*x]*Tan[c + d*x])/(2*d)
3.1.34.3.1 Defintions of rubi rules used
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Int[ExpandTrig[(a + b*csc[e + f*x])^m*(d*csc[e + f *x])^n, x], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] && I GtQ[m, 0] && RationalQ[n]
Time = 0.64 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.25
method | result | size |
derivativedivides | \(\frac {a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 a^{4} \tan \left (d x +c \right )+6 a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 a^{4} \left (d x +c \right )+a^{4} \sin \left (d x +c \right )}{d}\) | \(91\) |
default | \(\frac {a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 a^{4} \tan \left (d x +c \right )+6 a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 a^{4} \left (d x +c \right )+a^{4} \sin \left (d x +c \right )}{d}\) | \(91\) |
parallelrisch | \(\frac {a^{4} \left (-13 \left (1+\cos \left (2 d x +2 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+8 d x \cos \left (2 d x +2 c \right )+13 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \cos \left (2 d x +2 c \right )+8 d x +13 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+3 \sin \left (d x +c \right )+8 \sin \left (2 d x +2 c \right )+\sin \left (3 d x +3 c \right )\right )}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(130\) |
risch | \(4 a^{4} x -\frac {i a^{4} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{4} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {i a^{4} \left ({\mathrm e}^{3 i \left (d x +c \right )}-8 \,{\mathrm e}^{2 i \left (d x +c \right )}-{\mathrm e}^{i \left (d x +c \right )}-8\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {13 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {13 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}\) | \(141\) |
norman | \(\frac {-4 a^{4} x -\frac {11 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {13 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}+\frac {3 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {5 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+8 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-8 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+4 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}-\frac {13 a^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {13 a^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(205\) |
1/d*(a^4*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))+4*a^4*t an(d*x+c)+6*a^4*ln(sec(d*x+c)+tan(d*x+c))+4*a^4*(d*x+c)+a^4*sin(d*x+c))
Time = 0.33 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.52 \[ \int \cos (c+d x) (a+a \sec (c+d x))^4 \, dx=\frac {16 \, a^{4} d x \cos \left (d x + c\right )^{2} + 13 \, a^{4} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - 13 \, a^{4} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, a^{4} \cos \left (d x + c\right )^{2} + 8 \, a^{4} \cos \left (d x + c\right ) + a^{4}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]
1/4*(16*a^4*d*x*cos(d*x + c)^2 + 13*a^4*cos(d*x + c)^2*log(sin(d*x + c) + 1) - 13*a^4*cos(d*x + c)^2*log(-sin(d*x + c) + 1) + 2*(2*a^4*cos(d*x + c)^ 2 + 8*a^4*cos(d*x + c) + a^4)*sin(d*x + c))/(d*cos(d*x + c)^2)
\[ \int \cos (c+d x) (a+a \sec (c+d x))^4 \, dx=a^{4} \left (\int 4 \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 6 \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 4 \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int \cos {\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int \cos {\left (c + d x \right )}\, dx\right ) \]
a**4*(Integral(4*cos(c + d*x)*sec(c + d*x), x) + Integral(6*cos(c + d*x)*s ec(c + d*x)**2, x) + Integral(4*cos(c + d*x)*sec(c + d*x)**3, x) + Integra l(cos(c + d*x)*sec(c + d*x)**4, x) + Integral(cos(c + d*x), x))
Time = 0.21 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.51 \[ \int \cos (c+d x) (a+a \sec (c+d x))^4 \, dx=\frac {16 \, {\left (d x + c\right )} a^{4} - a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, a^{4} \sin \left (d x + c\right ) + 16 \, a^{4} \tan \left (d x + c\right )}{4 \, d} \]
1/4*(16*(d*x + c)*a^4 - a^4*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin (d*x + c) + 1) + log(sin(d*x + c) - 1)) + 12*a^4*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 4*a^4*sin(d*x + c) + 16*a^4*tan(d*x + c))/d
Time = 0.34 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.77 \[ \int \cos (c+d x) (a+a \sec (c+d x))^4 \, dx=\frac {8 \, {\left (d x + c\right )} a^{4} + 13 \, a^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 13 \, a^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {4 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} - \frac {2 \, {\left (7 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]
1/2*(8*(d*x + c)*a^4 + 13*a^4*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 13*a^4* log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 4*a^4*tan(1/2*d*x + 1/2*c)/(tan(1/2*d *x + 1/2*c)^2 + 1) - 2*(7*a^4*tan(1/2*d*x + 1/2*c)^3 - 9*a^4*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^2)/d
Time = 13.42 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.58 \[ \int \cos (c+d x) (a+a \sec (c+d x))^4 \, dx=4\,a^4\,x+\frac {13\,a^4\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {5\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+2\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-11\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]